import 'package:flutter/material.dart';

class MyApp2 extends StatelessWidget {
  MyApp2({super.key, this.name, this.age});

  String? name;
  int? age;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('无状态组件'),
        backgroundColor: const Color.fromARGB(255, 255, 0, 0),
      ),
      body: Center(
        child: Text('我叫$name, 今年$age'),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          // setState(() {

          // });
        },
        child: const Icon(Icons.add),
      ),
    );
  }
}
